﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace BusinessLayer
{
    public class DatatableToStringArray
    {
        public static string[] Convert(DataTable table, string columnName)
        {
            string[] array = table
                     .AsEnumerable()
                     .Select(row => row.Field<string>(columnName))
                     .ToArray();
            return array;
        }
    }
}
